<?php
$T->loadTpl("./html/".$template."/".$qname.".html");
$T->SetTpl('cssjs','html/cssjs.inc'); 
$T->SetTpl('jsmodel','html/jsmodel.inc');     
  
$p=isset($_GET["p"])?$_GET["p"]:"1";
$offset = ($p-1)*15;
if($offset<0) $offset = 0;
$logtype=isset($_GET['logtype'])?$_GET['logtype']:"";
$s_name=isset($_GET['s_name'])?$_GET['s_name']:"";
$n_where="where 1=1 ";
if(!empty($s_name)){
	$n_where .= " and B.truename like '%".$s_name."%' ";
}
if(($logtype)>49){
	$n_where .= " and C.id=".$logtype."  ";
}
$T->SetBlock("list","select A.*,B.truename,C.name from sys_log as A left join sys_member as B on B.id=A.oper_id left join sys_dict as C on C.id=A.sub_id ".$n_where." order by A.id desc limit {$offset},15 ");
if($p<1)$p=1;
$rc=$T->db->query("select count(*) from sys_log as A left join sys_member as B on B.id=A.oper_id left join sys_dict as C on C.id=A.sub_id ".$n_where)->fetchColumn(0);
$page=getPageHtml_bt($rc,15,$p,"&t=system_log&logtype=".$logtype."&s_name=".$s_name);
$page=mb_convert_encoding($page, 'utf-8', 'utf-8');
$T->Set("page",$page);
$T->Set("s_name",$s_name);
$T->Set("logtype",$logtype);


$T->Set("template",$template);         
$T->clearNaN();       
$T->clearNoN();
$T->display(); 